import { defineConfig, presetUno, presetAttributify, presetIcons } from 'unocss'

export default defineConfig({
  presets: [
    presetUno(),
    presetAttributify(),
    presetIcons({
      scale: 1.2,
      warn: true,
    }),
  ],
  theme: {
    colors: {
      primary: '#1989fa',
      success: '#07c160',
      warning: '#ff976a',
      danger: '#ee0a24',
    },
    breakpoints: {
      xs: '320px',
      sm: '640px',
      md: '768px',
      lg: '1024px',
      xl: '1280px',
    },
  },
  shortcuts: [
    // 移动端常用布局
    ['flex-center', 'flex items-center justify-center'],
    ['flex-between', 'flex items-center justify-between'],
    ['flex-around', 'flex items-center justify-around'],
    ['flex-col-center', 'flex flex-col items-center justify-center'],
    
    // 移动端安全区域
    ['safe-area-top', 'pt-[env(safe-area-inset-top)]'],
    ['safe-area-bottom', 'pb-[env(safe-area-inset-bottom)]'],
    
    // 常用间距
    ['p-page', 'px-4 py-3'],
    ['m-page', 'mx-4 my-3'],
  ],
})